找传奇、传世资源到传世资源站!

C#短信猫二次开发(收短信/发短信)示例源码

8.5玩家评分(1人评分)
下载后可评
介绍 评论 失效链接反馈

from clipboard
from clipboard
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.Runtime.InteropServices;using System.IO.Ports;namespace SmsServer{ public partial class Form1 : Form { [DllImport("GSM.dll")] public static extern int LinkModem(int iPort); [DllImport("GSM.dll")] public static extern int CloseModem(); [DllImport("GSM.dll")] public static extern int CheckModem(); [DllImport("GSM.dll")] public static extern string GetService(); [DllImport("GSM.dll")] public static extern int SendSMS(String smsCenter, String phone, String msg); [DllImport("GSM.dll")] public static extern int NewMessageToWhere(int iSaveType); [DllImport("GSM.dll")] public static extern string GetNewMessage(); [DllImport("GSM.dll")] public static extern string GetMessage(int Index); [DllImport("GSM.dll")] public static extern int DeleteSMSByNo(int Index); [DllImport("GSM.dll")] public static extern int DeleteAllSMS(); [DllImport("GSM.dll")] public static extern string myTest(); public Form1() { InitializeComponent(); } private void 连接设备ToolStripMenuItem_Click(object sender, EventArgs e) { if (this.comboBox1.Text.Trim() != "") { if (LinkModem(int.Parse(comboBox1.Text.Trim().Substring(3,1))) > 0) MessageBox.Show("连接设备成功!"); else MessageBox.Show("连接设备失败!"); } else MessageBox.Show("请先选择串口号!"); } private void toolStripMenuItem1_Click(object sender, EventArgs e) { panel2.Visible = true; panel2.Dock = DockStyle.Fill; foreach (string vPortName in SerialPort.GetPortNames()) { this.comboBox1.Items.Add(vPortName); } } private void 发送短信ToolStripMenuItem_Click(object sender, EventArgs e) { string Service = GetService(); MessageBox.Show(Service); } }}

评论

发表评论必须先登陆, 您可以 登陆 或者 注册新账号 !


在线咨询: 问题反馈
客服QQ:174666394

有问题请留言,看到后及时答复